package com.briup.jd2511.jd2511_product_source.controller;

import com.briup.jd2511.jd2511_product_source.result.Result;
import com.briup.jd2511.jd2511_product_source.service.AnalysisService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "首页大屏模块")
@RestController
@RequestMapping("/analysis")
public class AnalysisController {

    @Autowired
    private AnalysisService analysisService;

    @GetMapping("/count")
    @Operation(summary = "统计数量信息")
    public Result count() {
        return Result.success(analysisService.countNum());
    }

    @GetMapping("/countSales")
    @Operation(summary = "统计年度销量")
    public Result countSales() {
        return Result.success(analysisService.countSales());
    }

    @GetMapping("/countDisease")
    @Operation(summary = "统计病症数量")
    public Result countDisease() {
        return Result.success(analysisService.countDisease());
    }

    @GetMapping("/indexCount")
    @Operation(summary = "统计动物体重")
    public Result indexCount() {
        return Result.success(analysisService.countWeight());
    }
}